const http = uni.$u.http
// const baseURL = 'http://192.168.1.5:8360';
const baseURL = 'https://www.daoyikeji.com'; 


export const getLogin = (data) => http.post('/api/auth/login', data)
//首页
//get请求，获取首页数据
export const getHomeData = () => http.get('/api/index/home')
//获取市场数据
export const getMarkStore = () => http.get('/api/index/getMarketStore', {
	params: {
		category_id,
		province,
		city,
		district,
		page,
		limit
	}
})
//新加市场接口
export const addMarkStore = () => http.post('/api/user/addMarketStore', {
	logo_img, // logo,
	name, // 市场名字,
	shot_name, // 市场简称,
	address, // 地址,
	online_time, // 营业时间,
	phone, // 电话,
	introduce, // 介绍,
	category_id // 导航id,
})
//协议获取接口
export const getAgreement = (id) => http.get('/api/index/getAgreement', {
	params: {
		id
	}
})
//协议获取接口
export const getAgreementData = (data) => http.get('/api/index/getAgreement', {
	params: data
})

//我的
//银行卡接口
export const getBank = () => http.get('/api/user/getcardList')
//提交银行卡
export const sendBank = (data) => http.post('/api/user/cardSubmit', data)
//删除银行卡
export const deleteBank = () => http.get(' /api/user/delcard', {
	params: {
		id
	}
})
//充值列表
export const getRechargeList = () => http.get(' /api/index/getRechargeList')
//获取加盟费接口
export const getRecharge = () => http.get('/api/index/getRechargeList', {
	params: {
		id
	}
})



// export const getAddress = ()=> http.get(\)


// 获取用户订单信息
export const getAddStoreInfo = (data) => http.get('/api/store/getAddStoreInfo', {
	params: data
})
// 获取入驻费用
export const getEntryFee = (data) => http.get('/api/index/getEntryFee', {
	params: data
})
// 获取用户订单信息
export const getOrderStatus = (data) => http.get('/api/user/getOrderStatus', {
	params: data
})
// 获取用户订单list
export const getOrderList = (data) => http.get('/api/user/getOrderList', {
	params: data
})
// 根据id 获取市场列表 查询参数 navId 行业ID name 市场名字  province 省 city 市  district 区
export const getMarkListById = (data) => http.get('/api/index/getMarkListById', {
	params: data
})
// 根基市场Id获取商家
export const getStoreListById = (data) => http.get('/api/index/getStoreListById', {
	params: data
})
// h获取商品全部评论
export const getCommentListById = (data) => http.get('/api/index/getCommentListById', {
	params: data
})
// 获取商家商品列表
export const getStoreGoodsList = (data) => http.get('/api/store/getStoreGoodsList', {
	params: data
})
export const getStoreGoodsListYihuo = (data) => http.get('/api/store/getStoreGoodsListYihuo', {
	params: data
})
export const getHomeStoreGoodsList = (data) => http.get('/api/index/getStoreGoodsList', {
	params: data
})
// 获取用户入驻的商户 
export const getUserStoreList = (data) => http.get('/api/store/getUserStoreList', {
	params: data
})
// 根据id 获取商品详情
export const getGoodsInfoById = (data) => http.get('/api/index/getGoodsInfoById', {
	params: data
})
export const getyihuoGoodsInfoById = (data) => http.get('/api/index/getyihuoGoodsInfoById', {
	params: data
})
export const getGoodsById = (data) => http.get('/api/index/getGoodsById', {
	params: data
})
// 根据id 查询分类
export const getCategoryList = (data) => http.get('/api/index/getCategoryList', {
	params: data
})
// 根据id 查询分类
export const getUserStoreInfo = (data) => http.get('/api/store/getUserStoreInfo', {
	params: data
}) // 根据id 查询分类
export const getUserOthenInfo = (data) => http.get('/api/store/getUserOthenInfo', {
	params: data
})
// 商品上架、下架接口
export const saveStoreGoods = (data) => http.post('/api/store/saveStoreGoods', data)
// 商品订单接口
export const orderConfim = (data) => http.post('/api/order/orderConfim', data)
// 获取商家订单
export const getUserStoreOrderList = (data) => http.get('/api/order/getUserStoreOrderList', {
	params: data
})
// 订单修改接口
export const saveOrder = (data) => http.post('/api/order/saveOrder', data)
// 根据id 获取订单详情
export const getOrderInfoById = (data) => http.get('/api/order/getOrderInfoById', {
	params: data
})
// 订单评论接口
export const orderComment = (data) => http.post('/api/order/orderComment', data)
// 订单删除接口
export const delOrderById = (data) => http.post('/api/order/delOrderById', data)
// 订单删除接口
export const delOrderAppariser = (data) => http.post('/api/order/delOrderAppariser', data)
// 商品收藏、取消收藏接口
export const collection = (data) => http.post('/api/store/collection', data)
// 获取用户默认地址
export const getUserAddressDefalut = () => http.get('/api/user/getUserAddressDefalut')
// 商品添加初始化接口
export const getStoreInfo = (data) => http.post('/api/store/getStoreInfo', data)
export const getyihuoFee = (data) => http.post('/api/store/getyihuoFee', data)

export const submitStoreGoodsYihuo = (data) => http.post('/api/store/submitStoreGoodsYihuo', data)
// 商品添加、编辑接口
export const submitStoreGoods = (data) => http.post('/api/store/submitStoreGoods', data)
// 退款申请
export const retreatOrder = (data) => http.post('/api/user/retreatOrder', data)
// 取消退款申请
export const cancelRetreatOrder = (data) => http.post('/api/user/cancelRetreatOrder', data)
// 通过退款申请
export const comfigretreatOrder = (data) => http.post('/api/user/comfigretreatOrder', data)
// 退款申请
export const getRetreatOrderList = (data) => http.get('/api/user/getRetreatOrderList', {
	params: data
})
// 获取用户账变记录
export const getUserReproy = (data) => http.get('/api/user/getUserReproy', {
	params: data
})
// 图片上传统一接口 fileName 需要问一下后端！！！！！！！！ 参考页面 modeuleD/hongShanHun/addShop
export const uploadImg = (data) => {
	return new Promise((resolve, reject) => {
		let a = uni.uploadFile({
			url: baseURL + '/api/upload/img', // 仅为示例，非真实的接口地址
			filePath: data.url,
			name: 'file',
			formData: {
				fileName: data.fileName
			},
			success: (res) => {
				const data = JSON.parse(res.data)
				resolve(data.data.fileUrl)
			}
		});
	})
}
// 视频上传统一接口 fileName 需要问一下后端！！！！！！！！参考页面 modeuleD/hongShanHun/addShop
export const uploadVideo = (data) => {
	return new Promise((resolve, reject) => {
		let a = uni.uploadFile({
			url: baseURL + '/api/upload/video', // 仅为示例，非真实的接口地址
			filePath: data.url,
			name: 'file',
			formData: {
				fileName: data.fileName
			},
			success: (res) => {
				const data = JSON.parse(res.data)
				resolve(data.data.fileUrl)
			}
		});
	})
}

export const getAddress = () => http.get('/api/user/getAddress')
// 新增/修改收货地址接口
export const setAddress = (data) => http.post('/api/user/addressSubmit', data)
export const delAddress = (data) => http.get('/api/user/delAddress', {
	params: data
});
// 获取公司信息
export const getzytStore = () => http.get('/api/index/zytStore')


// 加入购物车
export const addCart = (data) => http.post('/api/cart/addCart', data)
// 删除购物车
export const delCartById = (data) => http.post('/api/cart/delCartById', data)
// 购物车选中、取消
export const cartCheckedById = (data) => http.post('/api/cart/cartCheckedById', data)
// 获取购物车
export const getCartList = (data) => http.get('/api/cart/getCartList', {
	params: data
});
// 订单提交页面获取购物车
export const getCartGoodsList = (data) => http.get('/api/cart/getCartGoodsList', {
	params: data
});
// 获取消息
export const getMsgList = (data) => http.post('/api/user/getMsgList', data)
// 获取消息
export const getStoreMsgList = (data) => http.post('/api/user/getStoreMsgList', data)
// 发送消息
export const sendMsg = (data) => http.post('/api/user/sendMsg', data)
// 获取用户消息列表
export const getUserMsgList = (data) => http.post('/api/user/getUserMsgList', data)
// 市场新加
export const addMarketStore = (data) => http.post('/api/index/addMarketStore', data)
// 招商入驻接口
export const addAttract = (data) => http.post('/api/store/addAttract', data)
// 招商入驻接口
export const getAttract = (data) => http.post('/api/store/getAttract', data)
// 获取招商经理列表
export const getAttractList = (data) => http.post('/api/store/getAttractList', data)
// 古玩入驻接口
export const addStore = (data) => http.post('/api/store/addStore', data)
// 代理入驻接口
export const addProxy = (data) => http.post('/api/store/addProxy', data)
// 代理入驻接口
export const getProxyInfo = (data) => http.post('/api/user/getProxyInfo', data)
// 代理入驻接口
export const getProxyList = (data) => http.post('/api/user/getProxyList', data)
// 代理入驻接口
export const getAttractInfo = (data) => http.post('/api/user/getAttractInfo', data)
// 代理入驻接口
export const getUserAttractList = (data) => http.post('/api/user/getUserAttractList', data)
// 订单提交页面获取购物车
export const getAllLinesGoods = (data) => http.get('/api/index/getAllLinesGoods', {
	params: data
});
// 名人画家
export const storePainter = (data) => http.post('/api/store/storePainter', data)
export const getUserPainter = (data) => http.get('/api/store/getUserPainter', {
	params: data
});
// 订单提交页面获取购物车
export const getPainterList = (data) => http.get('/api/index/getPainterList', {
	params: data
});
// 鉴定师
export const storeAppraiser = (data) => http.post('/api/store/storeAppraiser', data)
export const getUserAppraiser = (data) => http.get('/api/store/getUserAppraiser', {
	params: data
});
export const getAppraiserInfo = (data) => http.get('/api/index/getAppraiserInfo', {
	params: data
});
export const orderAppariser = (data) => http.post('/api/order/orderAppariser', data)
export const getOrderAppariser = (data) => http.post('/api/order/getOrderAppariser', data)


// 鉴定师
export const storeAppraiserSotre = (data) => http.post('/api/store/storeAppraiserStore', data)
export const getUserAppraiserSotre = (data) => http.get('/api/store/getUserAppraiserStore', {
	params: data
});

export const addViews = (data) => http.post('/api/index/addViews', data)

export const storeAuctionOmpany = (data) => http.post('/api/store/storeAuctionOmpany', data)
export const getUserAuctionOmpany = (data) => http.get('/api/store/getUserAuctionOmpany', {
	params: data
});
export const getAuctionOmpanyInfo = (data) => http.get('/api/store/getAuctionOmpanyInfo', {
	params: data
});


export const addAdvertisement = (data) => http.post('/api/store/addAdvertisement', data)
export const getAdvertisement = (data) => http.post('/api/store/getAdvertisement', data);
export const delAdvertisement = (data) => http.get('/api/store/delAdvertisement', {
	params: data
});

export const addAdvertisementHome = (data) => http.post('/api/store/addAdvertisementHome', data)
export const getAdvertisementHome = (data) => http.post('/api/store/getAdvertisementHome', data);
export const delAdvertisementHome = (data) => http.get('/api/store/delAdvertisementHome', {
	params: data
});

export const getAdvertisementIndex = (data) => http.post('/api/index/getAdvertisementHome', data);

export const getAdActivity = (data) => http.get('/api/index/getAdActivity', {
	params: data
});



export const storeAuctionGoods = (data) => http.post('/api/store/storeAuctionGoods', data);
export const getAuctionGoodsList = (data) => http.get('/api/index/getAuctionGoodsList', {
	params: data
});


export const getNowGoods = (data) => http.get('/api/auction/getNowGoods', {
	params: data
});
export const getAuctionOrderList = (data) => http.get('/api/auction/getAuctionOrderList', {
	params: data
});
export const getAuctionOrderById = (data) => http.get('/api/auction/getAuctionOrderById', {
	params: data
});
export const saveAuctionOrde = (data) => http.post('/api/auction/saveAuctionOrde', data);
export const delAuctionOrde = (data) => http.post('/api/auction/delAuctionOrde', data)


export const getPaiMaiDownTime = (data) => http.post('/api/index/getPaiMaiDownTime', data)

// 通用删除接口 只针对登录用户
export const delNameById = (data) => http.post('/api/store/delNameById', data)
// 通用删除接口 只针对登录用户
export const savePaySort = (data) => http.post('/api/store/savePaySort', data)
// 通用删除接口 只针对登录用户
export const getLSpaySort = (data) => http.post('/api/store/getLSpaySnSort', data)
// 通用删除接口 只针对登录用户
export const getLSpaySnSortgoods = (data) => http.post('/api/store/savePaySortgoods', data)
// 通用删除接口 只针对登录用户
export const delgoodsId = (data) => http.post('/api/store/delgoodsId', data)
export const delyihuogoodsId = (data) => http.post('/api/store/delyihuogoodsId', data)
export const getnews = (data) => http.get('/api/index/getnews', {
	params: data
});
// 通用删除接口 只针对登录用户
export const addNews = (data) => http.post('/api/store/addNews', data)
export const payouts = (data) => http.post('/api/user/payouts', data)
export const payoutsList = (data) => http.post('/api/user/payoutsList', data)
export const getYihuoList = (data) => http.post('/api/index/getYihuoList', data)
export const getgoodsAddress = (data) => http.post('/api/index/getgoodsAddress', data)


export const yihuoorder = (data) => http.post('/api/store/yihuoorder', data)

export const getyihuoorder = (data) => http.post('/api/store/getyihuoorder', data)
export const AdverList = (data) => http.post('/api/index/AdverList', data)
export const getQrCodeShichang = (data) => http.post('/api/store/getQrCodeShichang', data)